

<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
        <meta name="layout" content="main" />
        <title>Edit Position</title>
    </head>
    <body>
        <div class="nav">
            <span class="menuButton"><g:link class="home" controller="event"  action="home">Home</g:link></span>
            <span class="menuButton"><g:link class="list" action="list">Position List</g:link></span>
            <span class="menuButton"><g:link class="create" action="create">New Position</g:link></span>
        </div>
        <div class="body">
            <h1>Edit Position</h1>
            <g:if test="${flash.message}">
            <div class="message">${flash.message}</div>
            </g:if>
            <g:hasErrors bean="${positione}">
            <div class="errors">
                <g:renderErrors bean="${positione}" as="list" />
            </div>
            </g:hasErrors>
            <g:form method="post" >
                <input type="hidden" name="id" value="${positione?.id}" />
                <div class="dialog">
                    <table>
                        <tbody>
                            <tr class="prop">
                                <td valign="top" class="name">
                                    <label for="name">Name:</label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean:positione,field:'name','errors')}">
                                    <input type="text" id="name" name="name" value="${fieldValue(bean:positione,field:'name')}"/>
                                </td>
                            </tr>
                            <tr class="prop">
                                <td valign="top" class="name">
                                    <label for="description">Description:</label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean:positione,field:'description','errors')}">
                                    <input type="text" id="description" name="description" value="${fieldValue(bean:positione,field:'description')}"/>
                                </td>
                            </tr> 
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                    <label for="event">Event:</label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean:positione,field:'event','errors')}">
                                    <g:select optionKey="id" from="${Event.list()}" name="event.id" value="${positione?.event?.name}" ></g:select>
                                </td>
                            </tr> 

                            <tr class="prop">
                                <td valign="top" class="name">
                                    <label for="registrations">Registered Volunteers:</label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean:positione,field:'registrations','errors')}">
                                    
<ul>
<g:each var="r" in="${positione?.registrations}">
    <li><!--<g:link controller="positionRegistration" action="show" id="${r.id}">-->
        ${r.user?.name}
    <!--</g:link>-->
    </li>
</g:each>
</ul>
<!--<g:link controller="positionRegistration" params="['positione.id':positione?.id]" action="create">Register for Position</g:link>-->

                                </td>
                            </tr> 
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                    <label for="requiredVolunteers">Required Volunteers:</label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean:positione,field:'requiredVolunteers','errors')}">
                                    <input type="text" id="requiredVolunteers" name="requiredVolunteers" value="${fieldValue(bean:positione,field:'requiredVolunteers')}" />
                                </td>
                            </tr> 
                        
                        </tbody>
                    </table>
                </div>
                <div class="buttons">
                    <span class="button"><g:actionSubmit class="save" value="Update" /></span>
                    <span class="button"><g:actionSubmit class="delete" onclick="return confirm('Are you sure?');" value="Delete" /></span>
                </div>
            </g:form>
        </div>
    </body>
</html>
